package cn.com.cifi.mars.util;

import java.lang.reflect.Array;

public class ArrayUtils {

	public static boolean isEmpty(Object array) throws Exception {
		if (null == array) {
			return true;
		}
		if (isArray(array)) {
			return 0 == Array.getLength(array);
		}
		throw new Exception("Object to provide is not a Array !");
	}

	public static boolean isNotEmpty(Object array) throws Exception {
		return false == isEmpty(array);
	}

	public static boolean isArray(Object obj) {
		if (null == obj) {
			return false;
		}
		return obj.getClass().isArray();
	}
}
